const paginationBev = Behavior({

  data: {
    dataArray: [],
    total: 0,
    noneResult: false
  },

  methods: {

    setMoreData(dataArray) {
      const tempArray = this.data.dataArray.concat(dataArray);
      this.setData({
        dataArray: tempArray
      })
    },

    getCurrentStart() {
      return this.data.dataArray.length;
    },

    setTotal(total) {
      this.data.total = total;
      if (total == 0) {
        this.setData({
          noneResult: true
        })
      }
    },

    hasMore() {
      return this.data.dataArray.length >= this.data.total ? false : true;
    },

    initialize() {
      this.setData({
        dataArray: [],
        noneResult: false
      })
      this.data.total = 0;
    },

  }

})

export {
  paginationBev
}